﻿//********************************************************************************//
//创建日期：<创建日期，2010-08-02>
//创建作者：<王一飞，wangyifei@shanghai3h.com>
//功能说明：WTB_YEWUZB实体层次
//********************************************************************************//
#region Entity
namespace Entity
{
    using System;
    using System.Xml;
    [Serializable()]
    public class WTB_YEWUZB
    {

        private int m_bt_id;
        /// <summary>
        /// ID列，禁止关联
        /// </summary>
        public int ID { get { return m_bt_id; } set { m_bt_id = value; } }

        private string m_str_s_zhubiaobh;
        /// <summary>
        /// 主表编号
        /// </summary>
        public string S_ZHUBIAOBH { get { return m_str_s_zhubiaobh; } set { m_str_s_zhubiaobh = value; } }

        private string m_str_custom_type;
        /// <summary>
        /// 客户类型
        /// </summary>
        public string CUSTOM_TYPE { get { return m_str_custom_type; } set { m_str_custom_type = value; } }

        private string m_str_appdate;
        /// <summary>
        /// 申请时间
        /// </summary>
        public string APPDATE { get { return m_str_appdate; } set { m_str_appdate = value; } }

        private string m_str_contact_value;
        /// <summary>
        /// 电话号码
        /// </summary>
        public string CONTACT_VALUE { get { return m_str_contact_value; } set { m_str_contact_value = value; } }

        private string m_str_card_id;
        /// <summary>
        /// 销根号
        /// </summary>
        public string CARD_ID { get { return m_str_card_id; } set { m_str_card_id = value; } }

        private string m_str_apply_content;
        /// <summary>
        /// 申请内容
        /// </summary>
        public string APPLY_CONTENT { get { return m_str_apply_content; } set { m_str_apply_content = value; } }

        private string m_str_company_name;
        /// <summary>
        /// 企业名称
        /// </summary>
        public string COMPANY_NAME { get { return m_str_company_name; } set { m_str_company_name = value; } }

        private string m_str_company_type;
        /// <summary>
        /// 企业类型
        /// </summary>
        public string COMPANY_TYPE { get { return m_str_company_type; } set { m_str_company_type = value; } }

        private string m_str_social_credit_code;
        /// <summary>
        /// 统一社会信用代码
        /// </summary>
        public string SOCIAL_CREDIT_CODE { get { return m_str_social_credit_code; } set { m_str_social_credit_code = value; } }

        private string m_str_phone;
        /// <summary>
        /// 联系电话
        /// </summary>
        public string PHONE { get { return m_str_phone; } set { m_str_phone = value; } }

        private string m_str_wygz;
        /// <summary>
        /// 单位名称（盖章
        /// </summary>
        public string WYGZ { get { return m_str_wygz; } set { m_str_wygz = value; } }

        private string m_str_business_type;
        /// <summary>
        /// 业务类型,参见常量定义
        /// </summary>
        public string BUSINESS_TYPE { get { return m_str_business_type; } set { m_str_business_type = value; } }

        private string m_str_shw_address;
        /// <summary>
        /// 用水地址
        /// </summary>
        public string SHW_ADDRESS { get { return m_str_shw_address; } set { m_str_shw_address = value; } }

        private string m_str_applicant;
        /// <summary>
        /// 申请人
        /// </summary>
        public string APPLICANT { get { return m_str_applicant; } set { m_str_applicant = value; } }

        private string m_str_incident_type;
        /// <summary>
        /// 申请单类型
        /// </summary>
        public string INCIDENT_TYPE { get { return m_str_incident_type; } set { m_str_incident_type = value; } }

        private string m_str_cert_type;
        /// <summary>
        /// 证件类型
        /// </summary>
        public string CERT_TYPE { get { return m_str_cert_type; } set { m_str_cert_type = value; } }

        private string m_str_mail;
        /// <summary>
        /// 联系人邮箱
        /// </summary>
        public string MAIL { get { return m_str_mail; } set { m_str_mail = value; } }

        private string m_str_apply_no;
        /// <summary>
        /// 统一审批编码
        /// </summary>
        public string APPLY_NO { get { return m_str_apply_no; } set { m_str_apply_no = value; } }

        private string m_str_cert_number;
        /// <summary>
        /// 证件号码
        /// </summary>
        public string CERT_NUMBER { get { return m_str_cert_number; } set { m_str_cert_number = value; } }

        private string m_str_incident_id;
        /// <summary>
        /// 申请单唯一ID
        /// </summary>
        public string INCIDENT_ID { get { return m_str_incident_id; } set { m_str_incident_id = value; } }

        private string m_str_email;
        /// <summary>
        /// 电子邮箱
        /// </summary>
        public string EMAIL { get { return m_str_email; } set { m_str_email = value; } }

        private string m_str_address;
        /// <summary>
        /// 发生地址
        /// </summary>
        public string ADDRESS { get { return m_str_address; } set { m_str_address = value; } }

        private string m_str_con_name;
        /// <summary>
        /// 联系人
        /// </summary>
        public string CON_NAME { get { return m_str_con_name; } set { m_str_con_name = value; } }

        private DateTime? m_DT_d_caozuosj;
        /// <summary>
        /// 操作时间
        /// </summary>
        public DateTime? D_CAOZUOSJ { get { return m_DT_d_caozuosj; } set { m_DT_d_caozuosj = value; } }

        private int? m_bt_i_beiyong1;
        /// <summary>
        /// 
        /// </summary>
        public int? I_BEIYONG1 { get { return m_bt_i_beiyong1; } set { m_bt_i_beiyong1 = value; } }

        private int? m_bt_i_beiyong2;
        /// <summary>
        /// 
        /// </summary>
        public int? I_BEIYONG2 { get { return m_bt_i_beiyong2; } set { m_bt_i_beiyong2 = value; } }

        private string m_str_s_beiyogn1;
        /// <summary>
        /// kid/接水编号
        /// </summary>
        public string S_BEIYOGN1 { get { return m_str_s_beiyogn1; } set { m_str_s_beiyogn1 = value; } }

        private string m_str_s_beiyogn2;
        /// <summary>
        /// 
        /// </summary>
        public string S_BEIYOGN2 { get { return m_str_s_beiyogn2; } set { m_str_s_beiyogn2 = value; } }

        private string m_str_s_beiyogn3;
        /// <summary>
        /// 
        /// </summary>
        public string S_BEIYOGN3 { get { return m_str_s_beiyogn3; } set { m_str_s_beiyogn3 = value; } }

        private DateTime m_DT_d_jieshousj;
        /// <summary>
        /// 接收时间
        /// </summary>
        public DateTime D_JIESHOUSJ { get { return m_DT_d_jieshousj; } set { m_DT_d_jieshousj = value; } }

        private DateTime? m_DT_d_huitiansj;
        /// <summary>
        /// 回填时间
        /// </summary>
        public DateTime? D_HUITIANSJ { get { return m_DT_d_huitiansj; } set { m_DT_d_huitiansj = value; } }

        private DateTime? m_DT_d_beiyogn3;
        /// <summary>
        /// 
        /// </summary>
        public DateTime? D_BEIYOGN3 { get { return m_DT_d_beiyogn3; } set { m_DT_d_beiyogn3 = value; } }

        private int? m_bt_i_zhuangtai;
        /// <summary>
        /// 状态
        /// </summary>
        public int? I_ZHUANGTAI { get { return m_bt_i_zhuangtai; } set { m_bt_i_zhuangtai = value; } }

        private string m_str_is_transfer_order;
        /// <summary>
        /// 是否转单
        /// </summary>
        public string IS_TRANSFER_ORDER { get { return m_str_is_transfer_order; } set { m_str_is_transfer_order = value; } }

        private string m_str_shw_company_source;
        /// <summary>
        /// 申请转单的水务公司
        /// </summary>
        public string SHW_COMPANY_SOURCE { get { return m_str_shw_company_source; } set { m_str_shw_company_source = value; } }

        private string m_str_bill_address;
        /// <summary>
        /// 账单送达地址
        /// </summary>
        public string BILL_ADDRESS { get { return m_str_bill_address; } set { m_str_bill_address = value; } }
        public WTB_YEWUZB()
        {
        }
    }
}
#endregion
#region EntityProcess
namespace Access.BLL
{
    using System;
    using System.Data;
    //using System.Data.OracleClient;
    using Entity;
    using System.Configuration;
    using System.Data.Common;
    using Platform.Data;
    using Oracle.DataAccess.Client;
    using Oracle.DataAccess.Types;
    using Oracle.DataAccess;
    public class WTB_YEWUZBProcess
    {
        #region Field
        protected string conn;
        #endregion
        #region Construction
        public WTB_YEWUZBProcess() { conn = Platform.Configuration.ConfigHelper.BusinessConnString; }
        #endregion
        #region public

        /// <summary>
        /// 根据WTB_YEWUZB实体添加或者修改WTB_YEWUZB信息
        /// </summary>
        public bool InsertOrUpdate(WTB_YEWUZB WTB_YEWUZB, OracleTransaction Transaction)
        {
            if (WTB_YEWUZB.ID == 0)
            {
                InsertWTB_YEWUZB(WTB_YEWUZB, Transaction);
            }
            else
            {
                UpdateWTB_YEWUZB(WTB_YEWUZB, Transaction);
            }
            return WTB_YEWUZB.ID == 0 ? false : true;
        }

        /// <summary>
        /// 根据WTB_YEWUZB实体添加或修改WTB_YEWUZB信息
        /// </summary>
        public bool InsertOrUpdate(WTB_YEWUZB WTB_YEWUZB)
        {
            return InsertOrUpdate(WTB_YEWUZB, null);
        }



        /// <summary>
        /// 根据WTB_YEWUZB主键删除WTB_YEWUZB信息
        /// </summary>
        /// <param name="ID"></param>
        public bool DeleteWTB_YEWUZB(int ID, OracleTransaction Transaction)
        {
            string spName = "CS_DelWTB_YEWUZB";
            OracleParameter[] storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = ID;
            int result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery((OracleTransaction)Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }

        /// <summary>
        /// 根据WTB_YEWUZB主键删除WTB_YEWUZB信息
        /// </summary>
        /// <param name="ID"></param>
        public bool DeleteWTB_YEWUZB(int ID)
        {
            return DeleteWTB_YEWUZB(ID, null);
        }

        /// <summary>
        /// 根据条件删除WTB_YEWUZB信息
        /// </summary>
        /// <param name="WhereClause">条件子句(Oracle语句)不带where</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>如果删除成功，返回true,否则返回fals</returns>
        public bool DeleteWTB_YEWUZBsDynamic(string WhereClause, OracleTransaction Transaction)
        {
            string spName = "CS_DelWTB_YEWUZBsDyn";
            OracleParameter[] storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = WhereClause;
            int result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery((OracleTransaction)Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }

        /// <summary>
        /// 根据条件删除WTB_YEWUZB信息
        /// </summary>
        /// <param name="WhereClause">条件子句(Oracle语句)不带where</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>如果删除成功，返回true,否则返回fals</returns>
        public bool DeleteWTB_YEWUZBsDynamic(string WhereClause)
        {
            return DeleteWTB_YEWUZBsDynamic(WhereClause, null);
        }

        /// <summary>
        /// 根据WTB_YEWUZB主键选择WTB_YEWUZB信息
        /// </summary>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>WTB_YEWUZB信息</returns>
        public WTB_YEWUZB SelectWTB_YEWUZB(int ID, OracleTransaction Transaction)
        {
            string spName = "CS_SelWTB_YEWUZB";
            OracleParameter[] storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = ID;
            OracleDataReader rd;
            if (Transaction == null)
                rd = OracleHelper.ExecuteReader(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                rd = OracleHelper.ExecuteReader((OracleTransaction)Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (rd.Read())
            {
                WTB_YEWUZB WTB_YEWUZB = PopulateWTB_YEWUZB(rd);
                rd.Close();
                return WTB_YEWUZB;
            }
            else
                return null;
        }

        /// <summary>
        /// 根据WTB_YEWUZB主键选择WTB_YEWUZB信息
        /// </summary>
        /// <returns>WTB_YEWUZB信息</returns>
        public WTB_YEWUZB SelectWTB_YEWUZB(int ID)
        {
            return SelectWTB_YEWUZB(ID, null);
        }

        /// <summary>
        /// 选择所有WTB_YEWUZB信息
        /// </summary>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>所有WTB_YEWUZB信息</returns>
        public DataTable SelectWTB_YEWUZBsAll(OracleTransaction Transaction)
        {
            string spName = "CS_SelWTB_YEWUZBsAll";
            OracleParameter[] storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset((OracleTransaction)Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            else
                return null;
        }

        /// <summary>
        /// 选择所有WTB_YEWUZB信息
        /// </summary>
        /// <returns>所有WTB_YEWUZB信息</returns>
        public DataTable SelectWTB_YEWUZBsAll()
        {
            return SelectWTB_YEWUZBsAll(null);
        }

        /// <summary>
        /// 根据条件选择WTB_YEWUZB信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>WTB_YEWUZB信息</returns>
        public DataTable SelectWTB_YEWUZBsDynamic(string WhereClause, string OrderByExpression, OracleTransaction Transaction)
        {
            string spName = "CS_SelWTB_YEWUZBsDyn";
            OracleParameter[] storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = string.IsNullOrEmpty(WhereClause.Trim()) ? "1=1" : WhereClause;
            storedParams[1].Value = OrderByExpression;
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset((OracleTransaction)Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            else
                return null;
        }


        /// <summary>
        /// 根据条件选择WTB_YEWUZB信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <returns>WTB_YEWUZB信息</returns>
        public DataTable SelectWTB_YEWUZBsDynamic(string WhereClause, string OrderByExpression)
        {
            return SelectWTB_YEWUZBsDynamic(WhereClause, OrderByExpression, null);
        }



        /// <summary>
        /// 根据条件选择WTB_YEWUZB信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="PageIndex">页码</param>
        /// <param name="PageSize">页数</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>WTB_YEWUZB信息</returns>
        public DataTable SelectWTB_YEWUZBsDynamic(string WhereClause, string OrderByExpression, int PageIndex, int PageSize, OracleTransaction Transaction)
        {
            string spName = "CS_SelWTB_YEWUZBsDynPaged";
            OracleParameter[] storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = string.IsNullOrEmpty(WhereClause.Trim()) ? "1=1" : WhereClause;
            storedParams[1].Value = OrderByExpression;
            storedParams[2].Value = PageIndex;
            storedParams[3].Value = PageSize;
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset((OracleTransaction)Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            else
                return null;
        }


        /// <summary>
        /// 根据条件选择WTB_YEWUZB信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="PageIndex">页码</param>
        /// <param name="PageSize">页数</param>
        /// <returns>WTB_YEWUZB信息</returns>
        public DataTable SelectWTB_YEWUZBsDynamic(string WhereClause, string OrderByExpression, int PageIndex, int PageSize)
        {
            return SelectWTB_YEWUZBsDynamic(WhereClause, OrderByExpression, PageIndex, PageSize, null);
        }

        /// <summary>
        ///根据条件更新WTB_YEWUZB字段
        /// </summary>
        /// <returns>受影响行数</returns>
        public int UpdateWTB_YEWUZBsDynamic(string UpdateValue, string WhereClause, OracleTransaction Transaction)
        {
            int result = 0;
            if (UpdateValue == "" || WhereClause == "")
            {
                return 0;
            }
            string spName = "CS_UpdWTB_YEWUZBDyn";
            OracleParameter[] storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            DataSet ds = null;
            storedParams[0].Value = UpdateValue;
            storedParams[1].Value = WhereClause;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset((OracleTransaction)Transaction, CommandType.StoredProcedure, spName, storedParams);
            result = Convert.ToInt32(storedParams[2].Value);
            return result;
        }

        /// <summary>
        ///根据条件更新WTB_YEWUZB字段
        /// </summary>
        /// <returns>受影响行数</returns>
        public int UpdateWTB_YEWUZBsDynamic(string UpdateValue, string WhereClause)
        {
            return UpdateWTB_YEWUZBsDynamic(UpdateValue, WhereClause, null);
        }


        #endregion
        #region Private

        private int InsertWTB_YEWUZB(WTB_YEWUZB WTB_YEWUZB, OracleTransaction Transaction)
        {
            string spName = "CS_InsWTB_YEWUZB";
            OracleParameter[] storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = WTB_YEWUZB.S_ZHUBIAOBH;
            storedParams[1].Value = WTB_YEWUZB.CUSTOM_TYPE;
            storedParams[2].Value = WTB_YEWUZB.APPDATE;
            storedParams[3].Value = WTB_YEWUZB.CONTACT_VALUE;
            storedParams[4].Value = WTB_YEWUZB.CARD_ID;
            storedParams[5].Value = WTB_YEWUZB.APPLY_CONTENT;
            storedParams[6].Value = WTB_YEWUZB.COMPANY_NAME;
            storedParams[7].Value = WTB_YEWUZB.COMPANY_TYPE;
            storedParams[8].Value = WTB_YEWUZB.SOCIAL_CREDIT_CODE;
            storedParams[9].Value = WTB_YEWUZB.PHONE;
            storedParams[10].Value = WTB_YEWUZB.WYGZ;
            storedParams[11].Value = WTB_YEWUZB.BUSINESS_TYPE;
            storedParams[12].Value = WTB_YEWUZB.SHW_ADDRESS;
            storedParams[13].Value = WTB_YEWUZB.APPLICANT;
            storedParams[14].Value = WTB_YEWUZB.INCIDENT_TYPE;
            storedParams[15].Value = WTB_YEWUZB.CERT_TYPE;
            storedParams[16].Value = WTB_YEWUZB.MAIL;
            storedParams[17].Value = WTB_YEWUZB.APPLY_NO;
            storedParams[18].Value = WTB_YEWUZB.CERT_NUMBER;
            storedParams[19].Value = WTB_YEWUZB.INCIDENT_ID;
            storedParams[20].Value = WTB_YEWUZB.EMAIL;
            storedParams[21].Value = WTB_YEWUZB.ADDRESS;
            storedParams[22].Value = WTB_YEWUZB.CON_NAME;
            storedParams[23].Value = WTB_YEWUZB.D_CAOZUOSJ;
            storedParams[24].Value = WTB_YEWUZB.I_BEIYONG1;
            storedParams[25].Value = WTB_YEWUZB.I_BEIYONG2;
            storedParams[26].Value = WTB_YEWUZB.S_BEIYOGN1;
            storedParams[27].Value = WTB_YEWUZB.S_BEIYOGN2;
            storedParams[28].Value = WTB_YEWUZB.S_BEIYOGN3;
            storedParams[29].Value = WTB_YEWUZB.D_JIESHOUSJ;
            storedParams[30].Value = WTB_YEWUZB.D_HUITIANSJ;
            storedParams[31].Value = WTB_YEWUZB.D_BEIYOGN3;
            storedParams[32].Value = WTB_YEWUZB.I_ZHUANGTAI;
            storedParams[33].Value = WTB_YEWUZB.IS_TRANSFER_ORDER;
            storedParams[34].Value = WTB_YEWUZB.SHW_COMPANY_SOURCE;
            storedParams[35].Value = WTB_YEWUZB.BILL_ADDRESS;
            int result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery((OracleTransaction)Transaction, CommandType.StoredProcedure, spName, storedParams);
            WTB_YEWUZB.ID = Convert.ToInt32(storedParams[36].Value);
            return result;
        }
        private bool UpdateWTB_YEWUZB(WTB_YEWUZB WTB_YEWUZB, OracleTransaction Transaction)
        {
            string spName = "CS_UpdWTB_YEWUZB";
            OracleParameter[] storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = WTB_YEWUZB.S_ZHUBIAOBH;
            storedParams[1].Value = WTB_YEWUZB.CUSTOM_TYPE;
            storedParams[2].Value = WTB_YEWUZB.APPDATE;
            storedParams[3].Value = WTB_YEWUZB.CONTACT_VALUE;
            storedParams[4].Value = WTB_YEWUZB.CARD_ID;
            storedParams[5].Value = WTB_YEWUZB.APPLY_CONTENT;
            storedParams[6].Value = WTB_YEWUZB.COMPANY_NAME;
            storedParams[7].Value = WTB_YEWUZB.COMPANY_TYPE;
            storedParams[8].Value = WTB_YEWUZB.SOCIAL_CREDIT_CODE;
            storedParams[9].Value = WTB_YEWUZB.PHONE;
            storedParams[10].Value = WTB_YEWUZB.WYGZ;
            storedParams[11].Value = WTB_YEWUZB.BUSINESS_TYPE;
            storedParams[12].Value = WTB_YEWUZB.SHW_ADDRESS;
            storedParams[13].Value = WTB_YEWUZB.APPLICANT;
            storedParams[14].Value = WTB_YEWUZB.INCIDENT_TYPE;
            storedParams[15].Value = WTB_YEWUZB.CERT_TYPE;
            storedParams[16].Value = WTB_YEWUZB.MAIL;
            storedParams[17].Value = WTB_YEWUZB.APPLY_NO;
            storedParams[18].Value = WTB_YEWUZB.CERT_NUMBER;
            storedParams[19].Value = WTB_YEWUZB.INCIDENT_ID;
            storedParams[20].Value = WTB_YEWUZB.EMAIL;
            storedParams[21].Value = WTB_YEWUZB.ADDRESS;
            storedParams[22].Value = WTB_YEWUZB.CON_NAME;
            storedParams[23].Value = WTB_YEWUZB.D_CAOZUOSJ;
            storedParams[24].Value = WTB_YEWUZB.I_BEIYONG1;
            storedParams[25].Value = WTB_YEWUZB.I_BEIYONG2;
            storedParams[26].Value = WTB_YEWUZB.S_BEIYOGN1;
            storedParams[27].Value = WTB_YEWUZB.S_BEIYOGN2;
            storedParams[28].Value = WTB_YEWUZB.S_BEIYOGN3;
            storedParams[29].Value = WTB_YEWUZB.D_JIESHOUSJ;
            storedParams[30].Value = WTB_YEWUZB.D_HUITIANSJ;
            storedParams[31].Value = WTB_YEWUZB.D_BEIYOGN3;
            storedParams[32].Value = WTB_YEWUZB.I_ZHUANGTAI;
            storedParams[33].Value = WTB_YEWUZB.IS_TRANSFER_ORDER;
            storedParams[34].Value = WTB_YEWUZB.SHW_COMPANY_SOURCE;
            storedParams[35].Value = WTB_YEWUZB.BILL_ADDRESS;
            storedParams[36].Value = WTB_YEWUZB.ID;
            int result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery((OracleTransaction)Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }


        private WTB_YEWUZB PopulateWTB_YEWUZB(IDataReader dr)
        {
            WTB_YEWUZB WTB_YEWUZB = new WTB_YEWUZB();
            WTB_YEWUZB.ID = dr["ID"] == DBNull.Value ? (int)0 : (int)dr["ID"];
            WTB_YEWUZB.S_ZHUBIAOBH = dr["S_ZHUBIAOBH"] == DBNull.Value ? null : (string)dr["S_ZHUBIAOBH"];
            WTB_YEWUZB.CUSTOM_TYPE = dr["CUSTOM_TYPE"] == DBNull.Value ? null : (string)dr["CUSTOM_TYPE"];
            WTB_YEWUZB.APPDATE = dr["APPDATE"] == DBNull.Value ? null : (string)dr["APPDATE"];
            WTB_YEWUZB.CONTACT_VALUE = dr["CONTACT_VALUE"] == DBNull.Value ? null : (string)dr["CONTACT_VALUE"];
            WTB_YEWUZB.CARD_ID = dr["CARD_ID"] == DBNull.Value ? null : (string)dr["CARD_ID"];
            WTB_YEWUZB.APPLY_CONTENT = dr["APPLY_CONTENT"] == DBNull.Value ? null : (string)dr["APPLY_CONTENT"];
            WTB_YEWUZB.COMPANY_NAME = dr["COMPANY_NAME"] == DBNull.Value ? null : (string)dr["COMPANY_NAME"];
            WTB_YEWUZB.COMPANY_TYPE = dr["COMPANY_TYPE"] == DBNull.Value ? null : (string)dr["COMPANY_TYPE"];
            WTB_YEWUZB.SOCIAL_CREDIT_CODE = dr["SOCIAL_CREDIT_CODE"] == DBNull.Value ? null : (string)dr["SOCIAL_CREDIT_CODE"];
            WTB_YEWUZB.PHONE = dr["PHONE"] == DBNull.Value ? null : (string)dr["PHONE"];
            WTB_YEWUZB.WYGZ = dr["WYGZ"] == DBNull.Value ? null : (string)dr["WYGZ"];
            WTB_YEWUZB.BUSINESS_TYPE = dr["BUSINESS_TYPE"] == DBNull.Value ? null : (string)dr["BUSINESS_TYPE"];
            WTB_YEWUZB.SHW_ADDRESS = dr["SHW_ADDRESS"] == DBNull.Value ? null : (string)dr["SHW_ADDRESS"];
            WTB_YEWUZB.APPLICANT = dr["APPLICANT"] == DBNull.Value ? null : (string)dr["APPLICANT"];
            WTB_YEWUZB.INCIDENT_TYPE = dr["INCIDENT_TYPE"] == DBNull.Value ? null : (string)dr["INCIDENT_TYPE"];
            WTB_YEWUZB.CERT_TYPE = dr["CERT_TYPE"] == DBNull.Value ? null : (string)dr["CERT_TYPE"];
            WTB_YEWUZB.MAIL = dr["MAIL"] == DBNull.Value ? null : (string)dr["MAIL"];
            WTB_YEWUZB.APPLY_NO = dr["APPLY_NO"] == DBNull.Value ? null : (string)dr["APPLY_NO"];
            WTB_YEWUZB.CERT_NUMBER = dr["CERT_NUMBER"] == DBNull.Value ? null : (string)dr["CERT_NUMBER"];
            WTB_YEWUZB.INCIDENT_ID = dr["INCIDENT_ID"] == DBNull.Value ? null : (string)dr["INCIDENT_ID"];
            WTB_YEWUZB.EMAIL = dr["EMAIL"] == DBNull.Value ? null : (string)dr["EMAIL"];
            WTB_YEWUZB.ADDRESS = dr["ADDRESS"] == DBNull.Value ? null : (string)dr["ADDRESS"];
            WTB_YEWUZB.CON_NAME = dr["CON_NAME"] == DBNull.Value ? null : (string)dr["CON_NAME"];
            WTB_YEWUZB.D_CAOZUOSJ = dr["D_CAOZUOSJ"] == DBNull.Value ? null : (DateTime?)dr["D_CAOZUOSJ"];
            WTB_YEWUZB.I_BEIYONG1 = dr["I_BEIYONG1"] == DBNull.Value ? null : (int?)dr["I_BEIYONG1"];
            WTB_YEWUZB.I_BEIYONG2 = dr["I_BEIYONG2"] == DBNull.Value ? null : (int?)dr["I_BEIYONG2"];
            WTB_YEWUZB.S_BEIYOGN1 = dr["S_BEIYOGN1"] == DBNull.Value ? null : (string)dr["S_BEIYOGN1"];
            WTB_YEWUZB.S_BEIYOGN2 = dr["S_BEIYOGN2"] == DBNull.Value ? null : (string)dr["S_BEIYOGN2"];
            WTB_YEWUZB.S_BEIYOGN3 = dr["S_BEIYOGN3"] == DBNull.Value ? null : (string)dr["S_BEIYOGN3"];
            WTB_YEWUZB.D_JIESHOUSJ = dr["D_JIESHOUSJ"] == DBNull.Value ? Convert.ToDateTime("1900-1-1") : (DateTime)dr["D_JIESHOUSJ"];
            WTB_YEWUZB.D_HUITIANSJ = dr["D_HUITIANSJ"] == DBNull.Value ? null : (DateTime?)dr["D_HUITIANSJ"];
            WTB_YEWUZB.D_BEIYOGN3 = dr["D_BEIYOGN3"] == DBNull.Value ? null : (DateTime?)dr["D_BEIYOGN3"];
            WTB_YEWUZB.I_ZHUANGTAI = dr["I_ZHUANGTAI"] == DBNull.Value ? null : (int?)dr["I_ZHUANGTAI"];
            WTB_YEWUZB.IS_TRANSFER_ORDER = dr["IS_TRANSFER_ORDER"] == DBNull.Value ? null : (string)dr["IS_TRANSFER_ORDER"];
            WTB_YEWUZB.SHW_COMPANY_SOURCE = dr["SHW_COMPANY_SOURCE"] == DBNull.Value ? null : (string)dr["SHW_COMPANY_SOURCE"];
            WTB_YEWUZB.BILL_ADDRESS = dr["BILL_ADDRESS"] == DBNull.Value ? null : (string)dr["BILL_ADDRESS"];
            return WTB_YEWUZB;
        }


        private void AddRowNumber(DataTable dt)
        {
            dt.Columns.Add(new DataColumn("RowNumber", typeof(int)));
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                dt.Rows[i][dt.Columns.Count - 1] = i + 1;
            }
        }
        #endregion
    }
}
#endregion